/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 文章模块
module.exports = [
  {
    url: '/v1/info-category/\\d+/info-news$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 31,
            'title': '技术铺后台管理系统免费开源！',
            'hits': 1,
            'recommend_type': [],
            'top': 1,
            'status': 1,
            'created_at': '2022-02-28 14:35:58',
            'updated_at': '2022-02-28 15:45:52'
          },
          {
            'id': 30,
            'title': '技术铺后台管理系统演示上线！',
            'hits': 1,
            'recommend_type': [],
            'top': 0,
            'status': 1,
            'created_at': '2022-02-28 14:35:42',
            'updated_at': '2022-02-28 15:13:08'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 2
        }
      }
      return success(result)
    }
  },
  {
    url: '/v1/info-category/\\d+/info-news/\\d+$',
    type: 'get',
    response: config => {
      const result = {
        'title': '技术铺后台管理系统免费开源！',
        'subtitle': '',
        'keywords': [],
        'description': '',
        'cover_image': [],
        'href': '',
        'href_target': '_blank',
        'rel': '',
        'recommend_type': [],
        'top': 1,
        'status': 1,
        'created_at': '2022-02-28 14:35:58',
        'source': '',
        'author': '',
        'content': ''
      }
      return success(result)
    }
  },
  // 添加
  {
    url: '/v1/info-category/\\d+/info-news$',
    type: 'post',
    response: config => {
      return success({}, '添加成功')
    }
  },
  // 修改
  {
    url: '/v1/info-category/\\d+/info-news/\\d+$',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟置顶
  {
    url: '/v1/info-category/\\d+/info-news/\\d+/top',
    type: 'patch',
    response: config => {
      return success({}, '置顶成功')
    }
  },
  // 模拟修改状态
  {
    url: '/v1/info-category/\\d+/info-news/\\d+/status',
    type: 'patch',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟删除
  {
    url: '/v1/info-category/\\d+/info-news/\.*',
    type: 'delete',
    response: config => {
      return success({}, '删除成功')
    }
  }
]
